package com.ayq.activiti.manager.service;


import com.ayq.activiti.common.util.PageParams;
import com.ayq.activiti.common.util.Ret;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.zip.ZipInputStream;

/**
 *
 * <p>模型接口</p>
 * <p>方法名:</p>
 * @Author ayq
 * @Date 2021/3/25 10:15
 */
public interface CustomModelService {

    /**
     *
     * <p>保存流程模型</p>
     * <p>方法名:saveModel</p>
     * @Author ayq
     * @Date 2021/3/25 10:08
     * @Param [modelId, name, description, json_xml, svg_xml, outStream]
     * @Return void
     */
    void saveModel(String modelId, String name, String description, String json_xml, String svg_xml, ByteArrayOutputStream outStream) throws Exception;

    /**
     *
     * <p>编辑时获取模型数据</p>
     * <p>方法名:getEditorJson</p>
     * @Author ayq
     * @Date 2021/3/25 10:20
     * @Param [modelId, modelNode]
     * @Return com.fasterxml.jackson.databind.node.ObjectNode
     */
    ObjectNode getEditorJson(String modelId, ObjectNode modelNode) throws Exception;

    /**
     * <p>获取对应系统流程菜单并汉化</p>
     * <p>方法名:getStencilset</p>
     * @Author ayq
     * @Date 2021/3/25 10:25
     * @Param [stencilsetStream]
     * @Return java.lang.String
     */
    String getStencilset(InputStream stencilsetStream) throws Exception;

    /**
     *
     * <p>模型列表</p>
     * <p>方法名:modelList</p>
     * @Author ayq
     * @Date 2021/3/25 10:30
     * @Param [pageParams]
     * @Return void
     */
    void modelList(PageParams pageParams);

    /**
     *
     * <p>创建空模型</p>
     * <p>方法名:newModel</p>
     * @Author ayq
     * @Date 2021/3/25 10:33
     * @Param [request, response]
     * @Return String
     */
    String newModel(HttpServletRequest request, HttpServletResponse response) throws Exception;

    /**
     *
     * <p>打包方式部署流程模型</p>
     * <p>方法名:deployModle</p>
     * @Author ayq
     * @Date 2021/3/25 10:37
     * @Param [file, zipInputStream, deploy, bytes,bpmnBytes]
     * @Return Ret
     */
    Ret deployModle(MultipartFile file, ZipInputStream zipInputStream, byte[] bytes, byte[] bpmnBytes) throws Exception;

    /**
     *
     * <p>删除流程模型</p>
     * <p>方法名:deleteModel</p>
     * @Author ayq
     * @Date 2021/3/25 10:53
     * @Param [id]
     * @Return boolean
     */
    boolean deleteModel(String id);
}
